import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JComponent;
import javax.swing.JFrame;


public abstract class GraphWindow extends JComponent {
        Value[] slices;
        int index = 0;

    public GraphWindow(int numSlices) {
        slices = new Value[numSlices];
    }
    
    public void addSlice(double value, Color c){
        
        slices[index] = new Value(value, c);
        this.index++;
                
    }
    
    public abstract void calculate(String[] a, int top, DataProcessor dp);
    
    public void display(){
        JFrame frame = new JFrame();
                frame.getContentPane().add(this);
                frame.setSize(400, 400);
                frame.setVisible(true);
                paint(frame.getGraphics());
    }

    // This method is called whenever the contents needs to be painted
    public abstract void paint(Graphics g);
}
